//
//  AdvertisementCell.m
//  mendianjieke
//
//  Created by 响当当 on 8/2/19.
//  Copyright © 2019 dongzheng. All rights reserved.
//

#import "AdvertisementCell.h"

@interface AdvertisementCell()
@property (nonatomic, strong)UIImageView *advertisementImageView;//广告
@end

@implementation AdvertisementCell

- (UIImageView *)advertisementImageView
{
    if (!_advertisementImageView)
    {
        _advertisementImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0,0,SCREEN_WIDTH,150*kUIScaleBasePlus)];
        _advertisementImageView.image = [UIImage imageNamed:@"guanggao"];
    }
    return _advertisementImageView;
}

- (void)setFrame:(CGRect)frame
{
    frame.origin.x += 10*kUIScaleBasePlus;
    
    frame.size.width -= 2 * 10*kUIScaleBasePlus;
    
    [super setFrame:frame];
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        self.layer.cornerRadius = 10;
        self.layer.masksToBounds = YES;
        
        [self.contentView addSubview:self.advertisementImageView];
    }
    return self;
}
@end
